          SUBROUTINE (HOLD.NO,PC.FILENAME,SHOULD.DELETE,CONV.TYPE,NO.STATUS,HDR.PRMPT)
** Version# 9.0002[2] - 08/08/2017 - 02:47pm - TSMITH - eclipse
*** V9.0002 Change - Custom Coding . - 08/08/2017 - TSMITH - eclipse
** Copied from CBP UT.DOWNLOAD.BATCHFILE Version# 9.0001 - 10/29/2013 - 10:41am - TSMITH - eclipse
*** V9.0001 Change - Custom Coding CUSTOM - 10/29/2013 - TSMITH - eclipse
** Copied from SP UT.DOWNLOAD.HOLDFILE Version# 9 - 04/11/2011 - 10:53am - BABS - main

*** Subroutine - UT.DOWNLOAD.HOLDFILE
*-------------------------------------------------------------------------*
*** This program will prompt the user for a filename, then download the
*** specified document from the hold file to that filename on the user's
*** PC.  It will also prompt them to see if they want to contvert the data
*** to one of the predefined formats.
*-------------------------------------------------------------------------*
*** Parameters:
*** HOLD.NO       - the record ID of the document to be downloaded    (IN)
*** PC.FILENAME   - The file that the prompt should default to        (IN)
*** SHOULD.DELETE - Flag indicating whether the record should be      (IN)
***               - deleted from the hold file after it is downloaded
*** CONV.TYPE     - A number from 1-7 corresponding to the list of    (IN)
***               - possible conversions.  If this is passed in, the
***               - program will not prompt the user for a conversion
***               - type, it will use the specified one.
*** NO.STATUS     - a flag indicating that this program should not    (IN)
***               - display the 'XX bytes transferred...' message
***               - after it is done downloading.
*** HDR.PRMPT     - a flag indicating that the user should be asked   (IN)
***               - if they wish to download the document headers or
***               - not.  This will only prompt if the download
***               - selection is anything other than 'Binary'.  The
***               - default is to not download headers.
*-------------------------------------------------------------------------*
*** Common Vars:
*-------------------------------------------------------------------------*
*** Phantom Friendly : NO
*** Java Friendly : NO
*-------------------------------------------------------------------------*
          WINDOW ,,60,4,3,,'Downloading Holdfile : ':HOLD.NO

          PRINT @(0,1):'Enter DOS Path Name : c:/pdf/delivery.bat '
          PRINT @(0,2):'(use / in place of \)'
*-------------------------------------------------------------------------*
          IF PC.FILENAME THEN
             DOSNAME = PC.FILENAME
          END
             DOSNAME = 'C:/pdf/delivery.bat'
       *   GET.PC.FILENAME FILE.NAME,PC.NAME,YES,'','',''
       *   IF FILE.NAME#'' AND PC.NAME#'' THEN
       *      PRINT @(22,1):FILE.NAME "L#30":
       *      DOSNAME = FILE.NAME
       *      GOTO INTITL
       *   END
INDOSN:   INP DOSNAME,22,1,30,'MCU'
          IF QUIT THEN GOTO ENDDOWN

INTITL:*
          CHOICES      = ''
          CHOICES<1,1> = 'ASCII - No Conversion'
          CHOICES<1,2> = 'ASCII - LF = CR/LF'
          CHOICES<1,3> = 'ASCII,LF=CR/LF,Tab col'
          CHOICES<1,4> = 'ASCII,LF=CR/LF,Tab col&pad'
          CHOICES<1,5> = 'Spreadsheet Reformat'
          CHOICES<1,6> = 'Fix Block - Remove LF'
          CHOICES<1,7> = 'Binary'

          IF CONV.TYPE THEN
             IF NUM(CONV.TYPE) THEN
                DL.TYPE = CONV.TYPE
                GOTO GOT.TYPE
             END
          END

          VAR = ''
          MENU.TABLE WORD,,,1,7,30,,,CHOICES,'Downloading'
          LOCATE WORD IN CHOICES<1> SETTING DL.TYPE ELSE GOTO ENDDOWN

GOT.TYPE: ***

          * If the download selection is anything other than Binary,
          * prompt the user if they wish to download the headers or not
          HDRS       = ''
          DWNLD.HDRS = ''
          IF HDR.PRMPT AND CHOICES<1,DL.TYPE> # 'Binary' THEN
             HDR.MSG = 'Download document headings (Y/N): '
INHDRS:      INP.PROMPT DWNLD.HDRS,HDR.MSG,'YN',1
             IF F12 THEN GOTO ENDDOWN
             IF DWNLD.HDRS THEN
                READV HDRS FROM RPTFILE,HOLD.NO,8 ELSE HDRS = ''
                HDRS = RAISE(HDRS)
             END
          END

          PRINT @(0,1):BLINK$:'Download to PC... Please Wait....'"L#55":NORM$
          PATH    = '&HOLD&,':HOLD.NO

          SUMMARY.COLS = YES
          TBYTES  = UNIX.TO.PC(DOSNAME,PATH,DL.TYPE,HDRS,'',SUMMARY.COLS)
          PC.FILENAME = DOSNAME

          IF NOT(NO.STATUS) THEN
             PRINT BELL:
             PRINT @(0,1):TBYTES:' bytes transferred to PC ... ' "L#45":
IN$$1:       INP A
          END

          IF (SHOULD.DELETE) THEN
             SPOOLER.DELETE HOLD.NO
          END

*-------------------------------------------------------------------------*
ENDDOWN:  WINDOW.CLOSE
          RETURN
*-------------------------------------------------------------------------*
!TSMITH~08/08/17~14:47
